<?php defined('IN_IA') or exit('Access Denied');?><!-- 平台返利记录 -->
<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('base/common-header', TEMPLATE_INCLUDEPATH)) : (include template('base/common-header', TEMPLATE_INCLUDEPATH));?>
<!-- 搜索 -->
<form action="<?php  echo aurl('index')?>" method="GET" id="form_search" class="table-top-search form-inline" style="float: right;padding-bottom: 15px">

    <input type="text" name="active_name" class="form-control" placeholder="搜索活动名称" value="<?php  echo $_GET['active_name'];?>">
    <input type="text" name="order_sn" class="form-control" placeholder="搜索关联订单号" value="<?php  echo $_GET['order_sn'];?>">
    <select name="transfers_type">
        <option value="" <?php  if($_GET['transfers_type']=="") { ?>selected="selected" <?php  } ?>>全部&emsp;</option>
        <option value="share" <?php  if($_GET['transfers_type']=="share") { ?>selected="selected" <?php  } ?>>分享&emsp;</option>
        <option value="recommand" <?php  if($_GET['transfers_type']=="recommand") { ?>selected="selected" <?php  } ?>>推荐&emsp;</option>
        <option value="signin" <?php  if($_GET['transfers_type']=="signin") { ?>selected="selected" <?php  } ?>>点亮&emsp;</option>
        <option value="share_open" <?php  if($_GET['transfers_type']=="share_open") { ?>selected="selected" <?php  } ?>>分享打开&emsp;</option>
        <option value="mch" <?php  if($_GET['transfers_type']=="mch") { ?>selected="selected" <?php  } ?>>店长返利&emsp;</option>
    </select>
    <?php  echo tpl_form_field_daterange('cav_time',$_GET['cav_time'])?>

    <button class="btn btn-warning">搜索</button>&emsp;
    <a class="btn btn-success" style="float:right" href="<?php  echo aurl('exportExcel')?>">导出数据</a>
</form>

<!-- 列表 -->
<form method="post" class="form-horizontal" id="form" name="form" action="">

    <table class="table table-hover">
        <tr>
            <th>ID</th>
            <th>活动名称</th>
            <th>用户信息</th>
            <th>返利类型</th>
            <th>返利方式</th>
            <th>金额</th>
            <th>返利时间</th>
            <th>关联订单号</th>
            <th>发送状态</th>
            <th>操作</th>
        </tr>
        <?php  if(is_array($list)) { foreach($list as $item) { ?>
        <tr>
            <td><?php  echo $item['uni_id'];?></td>
            <td><?php  echo $item['active_name'];?></td>
            <td><?php  echo userinfo($item['openid'])['nickname']?></td>
            <td><?php  echo $_W['NS']['transfers_type'][$item['type']];?></td>
            <td><?php  echo $_W['NS']['order_send_type'][$item['send_type']];?></td>
            <td><?php  echo $item['reward'];?>元</td>
            <td><?php  echo date("Y-m-d H:i",$item['create_time'])?></td>
            <td><?php  echo $item['order_sn'];?></td>
            <td><?php  echo $_W['NS']['transfers_status'][$item['status']];?>&ensp;<?php  echo $item['err_msg'];?></td>

            <td>
                <?php  if($item['status'] == 'fail') { ?>
                <a class="label label-success ajax-post confirm" href="<?php  echo aurl('replacement',['transfers_id'=>$item['id']])?>">补发</a>
                <?php  } ?>
            </td>
        </tr>
        <?php  } } ?>
    </table>
    <?php  echo $page;?>
</form>


<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('base/common-footer', TEMPLATE_INCLUDEPATH)) : (include template('base/common-footer', TEMPLATE_INCLUDEPATH));?><script>var we7CommonForModule = document.createElement("script");we7CommonForModule.src = '//cdn.w7.cc/we7/w7windowside.js?v=201904260003';document.body.appendChild(we7CommonForModule)
</script>